// import diff2html styles
@import '~diff2html/bundles/css/diff2html.min.css';

.main-container {
  // padding controll of .header-wrap and .content-main are moved to _layout and _form

  /*
   * header
   */
  header {

    // the container of h1
    div.title-container {
      padding-right: 5px;
      padding-left: 5px;
      margin-right: auto;
    }

    .btn-copy,
    .btn-copy-link,
    .btn-edit {
      @extend .text-muted;
      border: none;
      opacity: 0.3;

      &:not(:hover) {
        background-color: transparent;
      }
    }

    .btn-edit-tags {
      @extend .text-muted;
      opacity: 0.5;

      &.no-tags {
        opacity: 0.7;
      }
    }

    // change button opacity
    &:hover {

      .btn.btn-copy,
      .btn-copy-link,
      .btn.btn-edit,
      .btn.btn-edit-tags {
        opacity: unset;
      }
    }

    .btn-like,
    .btn-bookmark {
      font-size: 1.2em;
      line-height: 0.8em;
      border: none;

      &:not(:hover):not(.active) {
        background-color: transparent;
      }
    }

    .btn-like {
      &.active {
        @extend .btn-info;
      }
    }

    .btn-bookmark {
      &.active {
        @extend .btn-warning;
      }
    }

    .url-line {
      font-size: 1rem;
      color: #999;
    }

    h1.title {
      margin-top: 0;
      margin-bottom: 0;

      .d-flex {
        flex-wrap: wrap; // for long page path
      }

      // crowi layout only
      a.last-path {
        color: #ccc;

        &:hover {
          color: inherit;
        }
      }
    }

    .tag-viewer.new-page {
      display: none;
    }
  }

  // alert component settings
  .alert-trash,
  .alert-moved,
  .alert-unlinked,
  .alert-grant {
    padding: 10px 15px;
  }

  // show PageStatusAlert in default
  #page-status-alert .myadmin-alert {
    display: block;
  }
}

.main-container .main .content-main .revision-history {
  .revision-history-list {
    .revision-history-outer {

      // add border-top except of first element
      &:not(:first-of-type) {
        border-top: 1px solid $border;
      }

      .revision-history-main {
        .picture-lg {
          width: 32px;
          height: 32px;
        }

        .revision-history-meta {
          a:hover {
            cursor: pointer;
          }
        }

        .caret {
          transition: 0.4s;
          transform: rotate(-90deg);

          &.caret-opened {
            transform: rotate(0deg);
          }
        }
      }

      .revision-history-main-nodiff {
        .picture-container {
          min-width: 32px;
          text-align: center; // centering .picture
        }
      }

      .revision-history-diff {
        padding-left: 40px;
        color: #333;
      }
    }

    li {
      position: relative;
      list-style: none;
    }
  }

  // compacted list
  .revision-history-list-compact {
    .revision-history-outer-contiguous-nodiff {
      border-top: unset !important; // force unset border
    }
  }

  // adjust
  // this is for diff2html. hide page name from diff view
  .d2h-file-header {
    display: none;
  }

  .d2h-diff-tbody {
    background-color: white;
  }
}

/**
 * for table with handsontable modal button
 */
.editable-with-handsontable {
  position: relative;

  .handsontable-modal-trigger {
    position: absolute;
    top: 11px;
    right: 10px;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    vertical-align: bottom;
    background-color: transparent;
    border: none;
    opacity: 0;
  }

  .page-mobile & .handsontable-modal-trigger {
    opacity: 0.3;
  }

  &:hover .handsontable-modal-trigger {
    opacity: 1;
  }
}

/**
 * for drawio with drawio iframe button
 */
.editable-with-drawio {
  .drawio-iframe-trigger {
    top: 11px;
    right: 10px;
    z-index: 14;
    font-size: 12px;
    line-height: 1;
    color: $linktext;
    background-color: transparent;
    border: 1px solid $linktext;
    opacity: 1;

    &:hover {
      color: $white;
      background-color: $linktext;
    }
  }
}

/*
 * for Presentation
 */
.fullscreen-layer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100%;
  height: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease-out;

  & > * {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  }
}

.overlay-on {
  #wrapper {
    filter: blur(5px);
  }

  .fullscreen-layer {
    height: 100%;
    opacity: 1;
  }
}

#presentation-container {
  position: absolute;
  top: 5%;
  left: 5%;
  width: 90%;
  height: 90%;
  background: #000;

  iframe {
    width: 100%;
    height: 100%;
    border: 0;
  }
}
